
<%@ page import="restfuljobs.JobListing" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'jobListing.label', default: 'JobListing')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#list-jobListing" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
			<g:if test="${session.user && session.user.type == restfuljobs.User.Type.RECRUITER}">
				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
			</g:if>
			</ul>
		</div>
		<div id="list-jobListing" class="content scaffold-list" role="main">
			<h1><g:message code="default.list.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<table>
				<thead>
					<tr>
					
						<g:sortableColumn property="employer" title="${message(code: 'jobListing.employer.label', default: 'Employer')}" />
					
						<g:sortableColumn property="jobCategory" title="${message(code: 'jobListing.jobCategory.label', default: 'Job Category')}" />
					
						<g:sortableColumn property="jobDescription" title="${message(code: 'jobListing.jobDescription.label', default: 'Job Description')}" />
					
						<g:sortableColumn property="jobTitle" title="${message(code: 'jobListing.jobTitle.label', default: 'Job Title')}" />
					
						<g:sortableColumn property="jobType" title="${message(code: 'jobListing.jobType.label', default: 'Job Type')}" />
					
						<g:sortableColumn property="location" title="${message(code: 'jobListing.location.label', default: 'Location')}" />
						
						<g:sortableColumn property="salaryFrom" title="${message(code: 'jobListing.location.salaryFrom', default: 'Salary')}" />
						
						<th>&nbsp;</th>
					</tr>
				</thead>
				<tbody>
				<g:each in="${jobListingInstanceList}" status="i" var="jobListingInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
					
						<td><g:link action="show" id="${jobListingInstance.id}">${fieldValue(bean: jobListingInstance, field: "employer")}</g:link></td>
					
						<td>${fieldValue(bean: jobListingInstance, field: "jobCategory")}</td>
					
						<td>${fieldValue(bean: jobListingInstance, field: "jobDescription")}</td>
					
						<td>${fieldValue(bean: jobListingInstance, field: "jobTitle")}</td>
					
						<td>${fieldValue(bean: jobListingInstance, field: "jobType")}</td>
					
						<td>${fieldValue(bean: jobListingInstance, field: "location")}</td>
					
					    <td>$${fieldValue(bean: jobListingInstance, field: "salaryFrom")} - $${fieldValue(bean: jobListingInstance, field: "salaryTo")}</td>
					    <td>
					    <g:if test="${session.user == null || session.user.type == restfuljobs.User.Type.APPLICANT}">
					    	<g:link action="create" controller="jobApplication" id="${jobListingInstance.id}">Apply</g:link>
					    </g:if>
					    
					    </td>
					</tr>
				</g:each>
				</tbody>
			</table>
			<div class="pagination">
				<g:paginate total="${jobListingInstanceTotal}" />
			</div>
		</div>
	</body>
</html>
